

function colorswitch(name) {
	document.getElementById(name).style.backgroundColor = '#00DB04';
	document.getElementById(name).style.color = '#000';
	document.getElementById(name).value = 'Eingetragen';
}

function colorReset(name) {
	document.getElementById(name).style.backgroundColor = '#c50a1f';
	document.getElementById(name).style.color = '#fff';
	document.getElementById(name).value = 'Eintragen';
}

function emptyAll() {
	document.getElementById("vorname").value = '';
	document.getElementById("nachname").value = '';
	document.getElementById("email").value = '';
	document.getElementById("day").value = '';
	document.getElementById("content").value = '';
}


function changeNewUser(vname, nname, beschr, date, mail, fieldname, fieldval)
{
	document.getElementById('vorname').value=vname;
	document.getElementById('nachname').value=nname;
	document.getElementById('content').value=beschr;
	document.getElementById('day').value=date;		
	document.getElementById('email').value=mail;
	document.getElementById(fieldname).value=fieldval;		
	document.getElementById('newMember').submit();	
}


var newVName;
var newNName;
var newTitle;

function setModUser(vname, nname)
{
	newVName= vname;
	newNName= nname;
}

function setModList(ntitle)
{
	newTitle= ntitle;
}

function changeModUser(pid)
{
	document.getElementById('vorname').value=newVName;
	document.getElementById('nachname').value=newNName;
	document.getElementById('pid').value=pid;		
	document.getElementById('force').value='1';		
	document.getElementById('modUser').submit();	
}

function changeModList(lid)
{
	document.getElementById('title').value=newTitle;
	document.getElementById('lid').value=lid;		
	document.getElementById('force').value='1';		
	document.getElementById('modList').submit();	
}

function showNowForRealList(index){
	document.getElementById('listInfo').style.display='inline';
	document.getElementById('listInfoLegend').style.display='inline';
	document.getElementById('lists').selectedIndex = index;
}

function showNowForReal(index){
	document.getElementById('userInfo').style.display='inline';
	document.getElementById('userInfoLegend').style.display='inline';
	document.getElementById('members').selectedIndex = index;
}

function showNowForRealAddresses(index){
	document.getElementById('userAddress').style.display='inline';
	document.getElementById('userAddressLegend').style.display='inline';
	document.getElementById('members').selectedIndex = index;
}


function showListInfo()
{
	var selectedIndex = document.getElementById('lists').selectedIndex;
	document.getElementById('lid').value = document.getElementById('lists').options[selectedIndex].value;
	document.getElementById('index').value = selectedIndex;
	document.getElementById('modList').submit();
}

function showUserAdresses()
{
	var selectedIndex = document.getElementById('members').selectedIndex;
	document.getElementById('pid').value = document.getElementById('members').options[selectedIndex].value;
	document.getElementById('index').value = selectedIndex;
	document.getElementById('newEntry').value = "Neue Adresse eintragen...";
	document.getElementById('modUserAdresses').submit();
}

function showUserInfo() 
{
	var selectedIndex = document.getElementById('members').selectedIndex;
	document.getElementById('pid').value=document.getElementById('members').options[selectedIndex].value;
	document.getElementById('index').value = selectedIndex;
	document.getElementById('modUser').submit();
}

function specialBehaviourEnter(e)
{
	if (e.keyCode==13) 
	{
		document.getElementById('submitBTN').value = "Hinzufügen";
		document.getElementById('force').value = "1";
		document.getElementById('modUser').submit();
	}
}


